﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IBLL;

namespace MisBLL
{
    public class Sys0DAO : MarshalByRefObject, ISys0
    {
        protected MisEntity.DataEntityDataContext DbContext = new MisEntity.DataEntityDataContext();

        //获取进货单号
        public string GetNoBac()
        {
            MisEntity.SYS0 info = DbContext.SYS0.First<MisEntity.SYS0>(item => item.F1 == '1');
            info.NO_BAC += 1;
            DbContext.SubmitChanges();
            return info.NO_BAC.ToString();
        }

        //获取退货单号
        public string GetNoRac()
        {
            MisEntity.SYS0 info = DbContext.SYS0.First<MisEntity.SYS0>(item => item.F1 == '1');
            info.NO_RAC += 1;
            DbContext.SubmitChanges();
            return info.NO_RAC.ToString();
        }

        //获取批发销售单号
        public string GetNoSac()
        {
            MisEntity.SYS0 info = DbContext.SYS0.First<MisEntity.SYS0>(item => item.F1 == '1');
            info.NO_HANDIN += 1;
            DbContext.SubmitChanges();
            return info.NO_HANDIN.ToString();
        }
    }
}
